Serve Markdown alternates for pages and news posts - #3997
Merged
Conversation
Every page and news post written in Markdown now gets a .md route next to its HTML page, with front matter stripped and Liquid rendered, and the HTML head advertises it via link rel=alternate. This makes the content directly consumable by LLM tools.
Deploying www-ruby-lang-org with
|
| Latest commit: |
060e4b4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4c397898.www-ruby-lang-org.pages.dev |
| Branch Preview URL: | https://claude-zen-mclaren-a95bef.www-ruby-lang-org.pages.dev |
The Cloudflare build environment has no locale set, so the default external encoding is US-ASCII and reading non-ASCII sources broke the front matter match. Read with bom|utf-8 as Jekyll itself does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every Markdown page and news post now gets a
.mdroute next to its HTML page, so/en/about/can also be fetched as/en/about.md. The copy is the source with front matter stripped and Liquid rendered, so pages like/en/downloads.mdkeep their expanded release version numbers. The HTML head advertises the route via<link rel="alternate" type="text/markdown">. This implements the.mdroutes item from the LLM discoverability scorecard at https://ruby.evilmartians.com/ and adapts_plugins/markdown_alternates.rbfrom rubygems/guides#524. Pages whose URL does not end with/(such as404.md) and pages not written in Markdown are skipped, and generated news archive pages get no alternate. GitHub Pages serves the files astext/markdown; charset=utf-8.